With the increase in computer processing power an attack on single length DES keys is now feasible, causing a migration from single length to double or triple length DES keys. The HSM supports single, double and triple length DES keys within its command set. If a single length DES key is presented a single encrypt or decrypt is performed. If a double length DES key is presented the processing for encryption is to encrypt using the left key, decrypt using the right key and encrypt using the left key, the reverse is true for decryption. If a triple length DES key is presented the processing for encryption is to encrypt using the first key, decrypt using the second key and encrypt using the third key, the reverse is true for decryption. This supports the standard ANSI X9.52 mode when operating Triple DES
The HSM console or host commands recognise the key length by considering the first character of the presented key:
· If the first character of the key is a hexadecimal character (0 – 9 or A – F) this is considered to be the first character of a single length DES key.
· If the ZMK has been configured as double length and for some specific keys this is considered to be the first character of a double length DES key.
· If the first character is “K” or “S” this is an index to user or secure storage and a single length DES key is extracted. See section User Storage.
These modes are required for backwards compatibility.
· If the first character is not a hexadecimal character or “K” or “S” this is a key scheme tag and defines the key length and encryption scheme used the key follows the tag. Key schemes tags come in pairs one for double length DES keys and one for triple length DES keys. When a key scheme is used the encrypting key must be the Local Master Key or a double / triple length key for import / export.
There are currently two key schemes defined:
ANSI X9.17 method
Each key of a double or triple length key is encrypted separately using the ECB mode of encryption. This scheme is only available for import and export of keys and must be enabled via the Configure Security (CS) command.
The tags for this scheme are as follows:
X – Double length DES keys
Y – Triple length DES keys.
Variant method
Each key of a double or triple length key is encrypted separately using the ECB mode of encryption. For the second or third key, depending on whether it is a double or triple length key, a variant is applied to the encryption key. There are five variants to enable the encryption of each key distinctly. This application of variants enforces the key use as a double or triple length key and the key order. This scheme is available for encryption of keys under the Local Master Key and for import and export of keys.
The tags for this scheme are as follows:
U – Double length DES keys.
T – Triple length DES keys.
The Variants applied are as follows:
Double length key Key 1 of 2 – A6
Key 2 of 2 – 5A
Triple length key Key 1 of 3 – 6A
Key 2 of 3 – DE
Key 3 of 3 – 2B